﻿@model NextInventory.Model.Inventory.ProductsModel

@{
    ViewBag.Title = Model.ID == 0 ? "Add Product" : "Product Details";
}
<script type="text/javascript">
    $(document).ready(function () {
        $("#PurchaseDateID").datepicker();
        $("#MenufacturingDateID").datepicker();
        $("#ExpiryDateID").datepicker();
    });
</script>

@using (Html.BeginForm("ProductDetails", "Inventory", FormMethod.Post))
{
    @Html.HiddenFor(model => model.ID)
    @Html.ValidationSummary(true)

    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th>
                @Html.LabelFor(model => model.Name)
            </th>
            <td>
                @Html.TextBoxFor(model => model.Name, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Name)

            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Description)
            </th>
            <td>
                @Html.TextBoxFor(model => model.Description, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.Description)

            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.ExpiryDate)
            </th>
            <td>
                @Html.TextBoxFor(model => model.ExpiryDate, new { @class = "inp-form", @id = "ExpiryDateID" })
                @Html.ValidationMessageFor(model => model.ExpiryDate)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.PurchaseDate)
            </th>
            <td>
                @Html.TextBoxFor(model => model.PurchaseDate, new { @class = "inp-form", @id = "PurchaseDateID" })
                @Html.ValidationMessageFor(model => model.PurchaseDate)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.MenuFacturingDate)
            </th>
            <td>
                @Html.TextBoxFor(model => model.MenuFacturingDate, new { @class = "inp-form", @id = "MenufacturingDateID" })
                @Html.ValidationMessageFor(model => model.MenuFacturingDate)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.OpeningQty)
            </th>
            <td>
                @Html.TextBoxFor(model => model.OpeningQty, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.OpeningQty)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.OpeningValue)
            </th>
            <td>
                @Html.TextBoxFor(model => model.OpeningValue, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.OpeningValue)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.PurchaseRate)
            </th>
            <td>
                @Html.TextBoxFor(model => model.PurchaseRate, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.PurchaseRate)
            </td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.SaleRate)
            </th>
            <td>
                @Html.TextBoxFor(model => model.SaleRate, new { @class = "inp-form" })
                @Html.ValidationMessageFor(model => model.SaleRate)
            </td>
        </tr>

        <tr>
            <th>
                @Html.LabelFor(model => model.CategoryId)
            </th>
            <td>
                @Html.DropDownListFor(model => model.CategoryId, new SelectList(ViewBag.Categories, "CategoryId", "Name"), new { @class = "styledselect_form_1" })
                @Html.ValidationMessageFor(model => model.CategoryId)
            </td>
        </tr>

        <tr>
            <th>
                @Html.LabelFor(model => model.MenufacturerId)
            </th>
            <td>
                @Html.DropDownListFor(model => model.MenufacturerId, new SelectList(ViewBag.Menufacturers, "MenufacturerId", "Name"), new { @class = "styledselect_form_1" })
                @Html.ValidationMessageFor(model => model.MenufacturerId)
            </td>
        </tr>

        <tr>
            <th>
                @Html.LabelFor(model => model.ModelId)
            </th>
            <td>
                @Html.DropDownListFor(model => model.ModelId, new SelectList(ViewBag.Models, "ModelId", "Name"), new { @class = "styledselect_form_1" })
                @Html.ValidationMessageFor(model => model.ModelId)
            </td>
        </tr>

        <tr>
            <th></th>
            <td>
                <input type="submit" value="" class="form-submit" />
                <input type="reset" value="" class="form-reset" />
            </td>
        </tr>
    </table>
}